<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
  <head>
    <title>Example: Full - jWYSIWYG</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="/input/jwysiwyg/jquery.wysiwyg.css" type="text/css" />
    <script type='text/javascript'>

   function deliver(){
	    var dayth =  $( "#born_dayth" ).val();
	    var title =  $( "#title" ).val();
	    var content =  $( "#content" ).val();
	    alert ( title.trim());
		if ( dayth.trim().length>0 && title.trim().length>0 && content.trim().length>0) {
						
						 $.post("/inputContent",{"dayth": dayth, "title": title, "content":  content}, function(data) {
							  location.href= "/reviewContent?dayth="+dayth;			
							});
							
					}else{
						alert (dayth.trim()+ title.trim()+content.trim());
					}
   }
   
   function  cancel(){
	  $( "#born_dayth" ).val("");
	  $( "#title" ).val("");
	  $( "#content" ).setContent("");
   }
   
  
	 </script>
  </head>
  <body>
   
    <div style="padding:10px;">
     <h3>录入孕妇第n天的指导手册</h3>
    <div style="padding:0px 0px 10px;">
    请输入第几天:<input type="text" name="born_dayth" id="born_dayth" class="inputDefault" style="width:255px"  value="<s:property value='daythInfo.dayth'/>" />
    </div>
        <div style="padding:10px 0px;">
    标题：<input type="text" name="title" id="title" class="inputDefault" value="<s:property value='daythInfo.title'/>" style="width:310px" />
    </div>
    <div>
      <textarea name="content" id="content" rows="20" cols="50"> <s:property value='daythInfo.content'/></textarea>
    </div>
   <div style="padding:10px;">
   <button class="button wide" onclick="deliver();">提交</button>
    <button  onclick="cancel();">重置</button>
   </div>
    </div>
    <script type="text/javascript" src="/input/jquery/jquery-1.3.2.js"></script>
    <script type="text/javascript" src="/input/jwysiwyg/jquery.wysiwyg.js"></script>
    <script type="text/javascript">
(function($)
{
  $('#content').wysiwyg({});
})(jQuery);
    </script>
  </body>
</html>